<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="com.zmht.specedu.vo.Teachbook,com.zmht.specedu.vo.Soundstudy,java.util.*,com.zmht.specedu.rescue.web.form.TargetForm,com.zmht.specedu.vo.Soundstudy"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@page import="com.zmht.specedu.frame.model.PageInfoModel"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%
   /**
     * @author 张天兴
     * @since 2009/05/19
     */
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<fmt:setBundle basename="PathResource" scope="session" />
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<title>聋校备课与语言学习及矫治系统</title>
<link href="<%=request.getContextPath() %>/<fmt:message key='StylePath' />style2.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript">
        var contentSourceSrc;
    	var contentWindow;
    	var topWindow;
    	var bottomWindow;
    	var rightFrame;

    	var url = "<%=request.getContextPath()%>/teachBook.do?method=dowloadTeachBookFile&bookID=<c:out value="${__rescue_study_resouce_container_pinggu_.currentbook.bookId}" />";
    	
    	var chineseFile = url+"&fileType=chineseFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.jpgSubffix }" />";
    	var pinyinFile = url+"&fileType=pinyinFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.jpgSubffix }" />";
    	var mouthFile = url+"&fileType=mouthFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.aviSubffix }" />";
    	var pictureFile = url+"&fileType=pictureFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.jpgSubffix }" />";
    	var zimuFile = url+"&fileType=zimuFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.jpgSubffix }" />";
    	var signFile = url+"&fileType=signFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.aviSubffix }" />";
    	var soundFile = url+"&fileType=soundFile&fileSubffix=<c:out value="${__rescue_study_resouce_container_pinggu_.builder.wavSubffix }" />";

    	function topMenuChanged(index){
    		if(index==1){
    			contentSourceSrc = getImgSource(chineseFile);
    		}else if(index==2){
    			contentSourceSrc = getImgSource(pinyinFile);
    		}else if(index==3){
    			contentSourceSrc = getVadioSource(mouthFile);
    		}else if(index==4){
    			contentSourceSrc = getImgSource(pictureFile);
    		}else if(index==5){
    			contentSourceSrc = getImgSource(zimuFile);
    		}else if(index==6){
    			contentSourceSrc = getVadioSource(signFile);
    		}else if(index==7){
    			contentSourceSrc = getVadioSource(soundFile);
    		}

    		contentWindow.freshContent(contentSourceSrc);//改变中间显示区域的内容为菜单对应内容
    	}

    	function getImgSource(src){
    		return "<img src=\""+src+"\" width=\"100%\" height=\"449\" />";
    	}
    	function getVadioSource(src){
    		return "<object classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" width=\"100%\" height=\""+449+"\" id=\"MediaPlayer1\"><param name=\"FileName\" value=\""+src+"\" /><param name=\"AutoStart\" value=\"1\"/><param name=\"AutoSize\" value=\"1\"/></object>";
    	}
    	
        function go(pagenum){
           var obj=document.getElementById("currentPageId");
           obj.value=pagenum;
           document.forms[0].submit();
       	}
        function getStudentID(){
          	var radios = document.getElementsByName("student");
          	for(var i=0;i<radios.length;i++){
          		if(radios[i].checked){
          			return radios[i].value;
          		}
          	}
          	return "";
       	}
        function getTargetID(){
          	var radios2 = document.getElementsByName("target");
          	for(var i=0;i<radios2.length;i++){
          		if(radios2[i].checked){
          			return radios2[i].value;
          		}
          	}
          	return "";
        }
        function targetChanged(obj){
        	frameSetSubmit("&currentTargetID="+obj.value);
        } 
        function jumpToTeachBook(index){
			if(index<0){ 
				alert("已经是第一篇教材了."); 
				return;
			}
			var totalCount = <c:out value="${__rescue_study_resouce_container_pinggu_.totalBookCount}" />;
			if(index>=totalCount) {
				alert("已经是最后一篇教材了."); 
				return;
			}
			topWindow.enableAllImgs();//改变top工具栏的选中状态（未选中）
			contentWindow.freshContent("");//清空内容区域

			frameSetSubmit("&currentBookIndex="+index);
		}
        function frameSetSubmit(params){//以刷新页面的方式提交数据 （只提交左侧页面）
    		document.forms[0].action = "<%=request.getContextPath()%>/studpinggu.do?method=loadRightPanel&currentStudentID="+getStudentID()+params;
    		document.forms[0].submit();
    	}
        window.onload = function(){
    		contentWindow = self.parent.frames["center"];
    		topWindow = self.parent.frames["topFrame"];
    		bottomWindow = self.parent.frames["bottomFrame"];
    		rightFrame = self.parent.frames["rightFrame"];
    		
    	}
        </script>
</head>

<body class="right_style" bgcolor="#ccea68">
	<form method="post" action="">
  <table width="167" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="700" align="left" valign="top" background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_bg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="80">&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_01.gif" width="166" height="39" border="0"  /></td>
                  </tr>
                  <tr>
                    <td><table width="100%" border="0" cellspacing="3" cellpadding="0" >
                      <tr>
                        <td><table width="141" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="5" align="center" valign="bottom"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_top.gif" width="141" height="5" /></td>
                          </tr>
                          <tr>
                            <td align="center" valign="middle" class="right_center">
                            <div style="overflow:scroll; overflow-x:hidden; height:80px; width:130px;">
                            <table width="100%" border="0" cellspacing="5" cellpadding="0">
								<c:forEach items="${__rescue_study_resouce_container_pinggu_.students}" var="studentVar">
                                <tr>
                                  <td width="23%" align="center" valign="middle">
                                  <input type="radio" name="student" value="<c:out value="${studentVar.studentId}" />"  <c:if test="${__rescue_study_resouce_container_pinggu_.currentstudentID==studentVar.studentId}">checked</c:if> /></td>
                                  <td width="77%" align="left" valign="middle"><c:out value="${studentVar.sname}" /></td>
                                </tr>
								</c:forEach>
                            </table></div></td>
                          </tr>
                          <tr>
                            <td height="5" align="center" valign="top"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_bottom.gif" width="141" height="5" /></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                  
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_02.gif" width="166" height="42" border="0"  /></td>
                  </tr>
                  <tr>
                    <td><table width="100%" border="0" cellspacing="3" cellpadding="0" >
                      <tr>
                        <td><table width="141" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="5" align="center" valign="bottom"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_top.gif" width="141" height="5" /></td>
                          </tr>
                          <tr>
                            <td align="center" valign="middle" class="right_center">
                            <div style="overflow:scroll; overflow-x:hidden; height:80px; width:130px;">
                            <table width="100%" border="0" cellspacing="5" cellpadding="0">                                
								<c:forEach items="${__rescue_study_resouce_container_pinggu_.targets}" var="target">
                                <tr>
                                  <td width="23%" align="center" valign="middle">
                                  <input type="radio" name="target" id="radio4" onclick="targetChanged(this);" <c:if test="${__rescue_study_resouce_container_pinggu_.currentTarget.targetId==target.targetId}">checked</c:if> value="<c:out value="${target.targetId}" />" /></td>
                                  <td width="77%" align="left" valign="middle"><c:out value="${target.targetName}" /></td>
                                </tr>
                                </c:forEach>                             
                              
                                
                            </table>
                            </div></td>
                          </tr>
                          <tr>
                            <td height="5" align="center" valign="top"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/jzxx/right_bottom.gif" width="141" height="5" /></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                  
                  
                   <tr>
                    <td><table width="85%" border="0" cellspacing="2" cellpadding="0">                    
                      <tr>
                        <td align="center"><a href="javascript:jumpToTeachBook('<c:out value="${__rescue_study_resouce_container_pinggu_.currentBookIndex-1}" />');" onfocus="this.blur()">
								<img src="<%=request.getContextPath()%>/<fmt:message key='CommonImagePath' />jz_img/jzxx/shangyipian.gif" width="53" height="22" border="0" /></a></td>
                        <td align="center"><a href="javascript:jumpToTeachBook('<c:out value="${__rescue_study_resouce_container_pinggu_.currentBookIndex+1}" />');" onfocus="this.blur()">
								<img src="<%=request.getContextPath()%>/<fmt:message key='CommonImagePath' />jz_img/jzxx/xiayipian.gif" width="53" height="22" border="0" /></a></td>
                      </tr>
                    </table>
                </td>
              </tr>
              
                </table></td>
              </tr>
            </table></td>
          </tr>
      </table></td>
    </tr>
  </table>
</td></tr></table>
</form>
</body>
</html>
